﻿/*
 * Created by SharpDevelop.
 * User: Alice
 * Date: 03.03.2012
 * Time: 14:41
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;

namespace monoServer
{
	/// <summary>
	/// Description of User.
	/// </summary>
	public class User
	{
		private int _id;
		public int ID
		{
			get
			{
				return this._id;
			}
			set
			{
				this._id = value;
			}
		}
		private String _nickname;
		public String NickName
		{
			get
			{
				return this._nickname;
			}
			set
			{
				this._nickname = value;
			}
		}
		
		private String _password;
		public String Password
		{
			get
			{
				return this._password;
			}
			set
			{
				this._password = value;
			}
		}
		
		private bool _isLoggedIn;
		public bool IsLoggedIn
		{
			get
			{
				return this._isLoggedIn;
			}
			set
			{
				this._isLoggedIn = value;
			}
		}
		
		private int _countWrongPasswords;
		public int countWrongPassword
		{
			get
			{
				return this._countWrongPasswords;
			}
			set
			{
				this._countWrongPasswords = value;
			}
		}
		
		private long _bannedUntil;
		public long bannedUntil
		{
			get
			{
				return this._bannedUntil;
			}
			set
			{
				this._bannedUntil = value;
			}
		}
		
		private int _adminlevel;
		
		private int xposition;
		public int xPosition
		{
			get
			{
				return this.xposition;
			}
			set
			{
				this.xposition = value;
			}
		}
		
		private int yposition;
		public int yPosition
		{
			get
			{
				return this.yposition;
			}
			set
			{
				this.yposition = value;
			}
		}
		
		public Error e;
		
		public User()
		{
			this.IsLoggedIn = false;			
			this.e = null;
		}
		
		public User(int id, String name)
		{
			this.ID = id;
			this.NickName = name;
			this.Password = null;
			this.e = null;
			this.IsLoggedIn = false;
		}
		
		public User(int id, String name, String password)
		{
			this.ID = id;
			this.NickName = name;
			this.Password = password;
			this.e = null;
		}
		
		public User(int id, String name, int adminlevel)
		{
			this.ID = id;
			this.NickName = name;
			this._adminlevel = adminlevel;
			this.Password = null;
			this.e = null;
			this.IsLoggedIn = false;
			this.bannedUntil = 0;
			this.countWrongPassword = 0;
		}
		
		public int getAdminLevel()
		{
			return this._adminlevel;
		}
	}
}
